<style>
    .form-signin {
        max-width: 330px;
        padding: 15px;
        margin: 0 auto;
    }
    .form-signin .form-signin-heading,
    .form-signin .checkbox {
        margin-bottom: 10px;
    }
    .form-signin .checkbox {
        font-weight: normal;
    }
    .form-signin .form-control {
        position: relative;
        height: auto;
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        padding: 10px;
        font-size: 16px;
    }
    .form-signin .form-control:focus {
        z-index: 2;
    }
    .form-signin input[type="email"] {
        margin-bottom: -1px;
        border-bottom-right-radius: 0;
        border-bottom-left-radius: 0;
    }
    .form-signin input[type="password"] {
        margin-bottom: 10px;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }
</style>
<?php
//$reqs = Blyn::app()->getActiveSpace()->getSpaceEngine()->getWXJoinSpaceRequests();
$joinedUsers = Blyn::app()->getActiveSpace()->getSpaceEngine()->getJoinedSpaceRoles();
//$space = Blyn::app()->getActiveSpace();

if ($joinedUsers != NULL) {
    $model = new BDynamicFormModel();
    $roleField = 'media_roleId_membership';
    $model->addField($roleField);
}
?>

<div class="container">
<?php
//if ($joinedUsers != NULL) 
$form = $this->beginWidget('CActiveForm', array(
    "id" => "manage-myInfo-form",
    'enableAjaxValidation' => FALSE,
    'htmlOptions' => array('class' => 'form-signin', 'role' => 'form'),
        ));
?>
    <legend>
        <h3 class="form-signin-heading text-muted">
<?php
echo $control->getAjaxLink(
        array('id' => BUIMembership::Show_Approve_Membership, 'name' => '审批申请')
);
?>
            | 成员删除
        </h3>
    </legend>

    <div class="displayUserInfo">
<?php
if (isset($applyResult)) {
    if ($applyResult == 'deleted') {
        ?>
                <p class="bg-warning">
                    <strong>成员: <?php echo $userName; ?> 已成功删除.</strong>
                </p>
        <?php
    }
}
?>
        <?php
        if ($joinedUsers != NULL) {
            foreach ($joinedUsers as $reqId => $request) {
                $sender_user = new BUser($request['userId']);
                $sender_Space = new BSpace($request['spaceId']);
                $sender_sApp = Yii::t('site', BApp::getAppById($request['appId'])->name);
                $requestItem = array('messageId' => $reqId, 'roleId' => $request['roleId'], 'userId' => $request['userId']);
                ?>
                <!--<h5>用户：</h5>-->
                <?php echo '<h5>用户：' . $sender_user->getName() . '</h5>'; ?>
                <!--<h5>角色：</h5>-->
                <?php echo '<h5>角色：' . Yii::t('site', $request['applyingRole']) . '</h5>'; ?>
                <?php
                echo $control->getAjaxLink(array('name' => '删除成员', 'id' => BUIMembership::Delete_Apply), array(
                    'reqId' => $requestItem,
                    'messageId' => $reqId,
                    'roleId' => $request['roleId'],
                    'userId' => $request['userId'],
                    'htmlOptions' => array(
                        'class' => 'btn btn-success btn-lg btn-block'
                )));
                ?>        
                <?php
            }
        } else
            echo "暂无成员."
            ?> 
    </div>
        <?php //if ($joinedUsers != NULL) 
        $this->endWidget();
        ?>
</div>
